/*
 *    Copyright (c) 2018-2025, envpro All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: envpro
 */
package com.iwomy.envpro.platform.controller;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.func.Func1;
import com.alibaba.fastjson.JSONObject;
import com.iwomy.envpro.common.core.util.R;
import com.iwomy.envpro.common.security.annotation.Inner;
import com.iwomy.envpro.platform.dto.DeviceDataDTO;
import com.iwomy.envpro.platform.entity.AirRealTimeDataEntity;
import com.iwomy.envpro.platform.service.AirMonitorEquipmentService;
import com.iwomy.envpro.platform.service.AirRealTimeDataService;
import com.iwomy.envpro.platform.service.DeviceService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 数据源管理
 *
 * @author envpro
 * @date 2019-03-31 16:00:20
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/device")
@Slf4j
public class DeviceController {

	@Resource
	private DeviceService deviceService;


	/**
	 * 上报数据接口
	 * @return R
	 */
	@PostMapping("escalation")
	@Inner(false)
	public R escalation(@RequestBody String content) {
		log.info("escalation: {}",content);
//		deviceService.escalation(content);
		return R.ok();
	}


	/**
	 * 查询上报数据
	 * @return R
	 */
	@GetMapping()
	@Inner(false)
	public R getEscalation() {

		return R.ok();
	}

}
